home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / gtlayout-source.lha / LT_UpdateStrings.c < prev    next >
C/C++ Source or Header  |  1996-08-22  |  2KB  |  79 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. STATIC VOID
  15. LTP_UpdateStrings(ObjectNode *Group)
  16. {
  17.     ObjectNode    *Node;
  18.     ULONG         Page;
  19.  
  20.     SCANPAGE(Group,Node,Page)
  21.     {
  22.         switch(Node->Type)
  23.         {
  24.             case PASSWORD_KIND:
  25.             case STRING_KIND:
  26.             case INTEGER_KIND:
  27.  
  28.                 if(Node->Host)
  29.                     LTP_PutStorage(Node);
  30.  
  31.                 break;
  32.  
  33.             case GROUP_KIND:
  34.  
  35.                 LTP_UpdateStrings(Node);
  36.                 break;
  37.         }
  38.     }
  39. }
  40.  
  41. /****** gtlayout.library/LT_UpdateStrings ******************************************
  42. *
  43. *   NAME
  44. *    LT_UpdateStrings -- Make sure all visible string buffer contents
  45. *                        get written into storage (v9).
  46. *
  47. *   SYNOPSIS
  48. *    LT_UpdateStrings(LayoutHandle);
  49. *                            A0
  50. *
  51. *    VOID LT_UpdateStrings(struct LayoutHandle *);
  52. *
  53. *   FUNCTION
  54. *    The user can terminate input into a string gadget or an object
  55. *    derived from a string gadget by various means. They all have
  56. *    in common that the application receives no notification that
  57. *    the string gadget contents have changed. This is particularly
  58. *    nasty with objects which make use of LA_STRPTR or other
  59. *    tags. Using LT_UpdateStrings() you can force all visible string
  60. *    gadget objects to hand over their contents to the internal
  61. *    buffers. Do this before you eventually exit your input loop.
  62. *
  63. *   INPUTS
  64. *    LayoutHandle - Pointer to LayoutHandle structure.
  65. *
  66. *   RESULT
  67. *    none
  68. *
  69. ******************************************************************************
  70. *
  71. */
  72.  
  73. VOID LIBENT
  74. LT_UpdateStrings(REG(a0) LayoutHandle *Handle)
  75. {
  76.     if(Handle)
  77.         LTP_UpdateStrings(Handle->TopGroup);
  78. }
  79.